using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Lizk.SimpleHUD
{
#if !XBOX
    [TypeConverterAttribute(typeof(ColorConverter))]
#endif
    [Serializable]
    public struct ColorS
    {
        private byte a;

        public byte A
        {
            get { return a; }
            set { a = value; }
        }
        private byte r;

        public byte R
        {
            get { return r; }
            set { r = value; }
        }
        private byte g;

        public byte G
        {
            get { return g; }
            set { g = value; }
        }
        private byte b;

        public byte B
        {
            get { return b; }
            set { b = value; }
        }

        public ColorS(byte R, byte G, byte B)
        {
            a = 255;
            this.r = R;
            this.g = G;
            this.b = B;
        }

        public ColorS(byte R, byte G, byte B, byte A)
        {
            this.a = A;
            this.r = R;
            this.b = B;
            this.g = G;
        }

        public static ColorS Red
        {
            get { return new ColorS(255,0,0); }
        }
        public static ColorS Green
        {
            get { return new ColorS(0, 255, 0); }
        }
        public static ColorS Blue
        {
            get { return new ColorS(0, 0, 255); }
        }
        public static ColorS White
        {
            get { return new ColorS(255, 255, 255); }
        }
        public static ColorS Black
        {
            get { return new ColorS(0, 0, 0); }
        }


        public static object FromArgb(byte alpha, ColorS color)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public static object FromArgb(int p, byte p_2, byte p_3, byte p_4)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public bool Equals(ColorS obj)
        {
            return obj.A == A && obj.R == R && obj.g == g && obj.b == b;
        }
        
        
        public override bool Equals(object obj)
        {
            if (obj is ColorS)
                return Equals((ColorS)obj);
            return base.Equals(obj);
        }
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        //OverLoading == operator
        public static bool operator ==(ColorS x, ColorS y)
        {
            return x.A == y.A && x.R == y.R && x.g == y.g && x.b == y.b;
        }
        public static bool operator !=(ColorS x, ColorS y)
        {
            return !(x==y);
        }
    }
}
